<template>
  <!-- 访客记录-详情 -->
  <div>
    <public-modal
      width="1000px"
      :footer="false"
      title="实有人口详情页"
      modalStyle="detailModal"
      :publicVisible="publicVisible"
      cancelContext="拒绝"
      confirmContext="通过"
      @handleOk="handleOk"
      @cancel="cancel"
    >
      <div slot="content">
        <div class="common-title">
          <div class="icon"></div>
          <div class="content">身份信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">姓名</div>
              <div class="value common-value">{{ populationBean.fXm || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">人脸照片</div>
              <div
                class="value common-value deatil-color"
                v-if="populationBean.personImage"
                @click="handlePreviewFace([populationBean.personImage])"
              >
                查看
              </div>
              <div class="value common-value" v-else>暂无</div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">年龄</div>
              <div class="value common-value">{{ populationBean.age || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">性别</div>
              <div class="value common-value">
                {{ populationBean.fXb || '暂无' }}
              </div>
            </div>
          </div>

          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">身份证号</div>
              <div class="value common-value">{{ populationBean.fGmsfhm || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">联系方式</div>
              <div class="value common-value">
                {{ populationBean.fLxdh || '暂无' }}
              </div>
            </div>
          </div>
        </div>

        <div class="common-title">
          <div class="icon"></div>
          <div class="content">居住地址</div>
        </div>

        <a-table
          rowKey="id"
          class="tableList"
          :columns="columns"
          :dataSource="retingHouseBean"
          :pagination="false"
          style="margin: 20px 0; border: 1px solid #154b81"
        >
        </a-table>

        <div class="common-title">
          <div class="icon"></div>
          <div class="content">采集人信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">采集人员</div>
              <div class="value common-value">{{ populationBean.fCjrxm || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">人员类型</div>
              <div class="value common-value">
                {{ populationBean.fCjrlx || '暂无' }}
              </div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">采集时间</div>
              <div class="value common-value">{{ populationBean.fCjsj || '暂无' }}</div>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer"></div>
    </public-modal>
  </div>
</template>
<script>
import startEndTime from '@/components/startEndTime'
import publicModal from '@/components/publicModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { houseDetails } from '@/api/api'
import { webpopulationDetails } from '../../../../api/api'
import { previewImage } from '../../../../utils/util'

export default {
  name: 'actuallyDetail',
  components: { publicModal, startEndTime },
  mixins: [JeecgListMixin],
  data() {
    return {
      url: {
        list: '/common/project_company_serve_record/page',
      },
      publicVisible: false,
      columns: [
        {
          title: '序号',
          align: 'center',
          width: 100,
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '标准地址',
          align: 'center',
          dataIndex: 'fHjdzQhnxxdz',
        },
        {
          title: '与房主关系',
          align: 'center',
          dataIndex: 'fYfzgx',
          ellipsis: true,
        },
        {
          title: '所属派出所',
          align: 'center',
          dataIndex: 'policeAgencyName',
          ellipsis: true,
        },
      ],
      project_company_type: [],
      queryParams: { pageSize: 5 },
      ipagination: { pageSize: 5 },
      disableMixinCreated: true,
      populationBean: {},
      retingHouseBean: [],
    }
  },

  methods: {
    handlePreviewFace(urls) {
      previewImage.call(this, urls)
    },
    async show(records) {
      this.publicVisible = true
      this.getDetail(records)
    },
    getDetail(records) {
      const params = {
        id: records.id,
      }
      webpopulationDetails(params).then((res) => {
        if (res.code == 200) {
          const { populationBean, retingHouseBean } = res.result
          this.populationBean = populationBean
          this.retingHouseBean = retingHouseBean
        } else {
        }
      })
    },
    handleOk() {
      this.publicVisible = false
    },

    cancel(target) {
      this.publicVisible = false
    },
  },
}
</script>
<style scoped lang="less">
/deep/ .modalCotent {
  padding: 20px 40px;
  border-radius: 0 0 4px 4px;
}
</style>
